package com.sky.com.admin.handle;


import com.sky.com.admin.exception.BusinessException;
import com.sky.com.common.result.JsonResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class BaseExceptionHandler {
    @ExceptionHandler(value = Exception.class)
    public JsonResult error(Exception e){
    return JsonResult.error("异常错误！");
}
@ExceptionHandler(value = BusinessException.class)
    public JsonResult error(BusinessException e){
        return JsonResult.error(e.getMessage());
}
}
